#!/bin/bash

# 简单的Django后台运行脚本

# 启动Django服务器并后台运行
echo "启动 Django 服务器..."
nohup python manage.py runserver 0.0.0.0:8001 > django.log 2>&1 &

# 保存进程ID
echo $! > django.pid

echo "Django 服务器已在后台启动"
echo "进程ID: $(cat django.pid)"
echo "访问地址: http://0.0.0.0:8001"
echo "日志文件: django.log"
echo ""
echo "查看日志: tail -f django.log"
echo "停止服务器: kill \$(cat django.pid)"

